#pragma once

#include <string>

#include "Common.h"

#include <AtlasTexture.hpp>
#include <Color.hpp>
#include <Label.hpp>
#include <Rect2.hpp>
#include <SceneTree.hpp>
#include <Texture.hpp>
#include <TextureButton.hpp>
#include <Vector2.hpp>
#include <Viewport.hpp>

namespace godot {
class Cell: public TextureButton {
	GODOT_CLASS(Cell, TextureButton);
	
	unsigned short value, index, state = 0;
	
public:
	static void _register_methods();
	
	void _init();
	void _ready();
	
	void setup(const unsigned short value, const unsigned short index);
	
	void _on_Cell_button_up();
	void _on_Cell_button_down();
	void _on_Cell_pressed();
	
	void _set_state(const unsigned short state);
	unsigned short _get_state();
	
	void _toggle();
	void _untoggle();

private:
	void __change_color();
	void __change_position();
	void __reset_position();
};
}